﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Collections.Generic;

public partial class Hinh_Images : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Pager1.ChangePage += new EventHandler(Pager1_ChangePage);
        if (!IsPostBack)
        {
            string[] filesindirectory = Directory.GetFiles(Server.MapPath("~/Images1"));
            List<String> images = new List<string>(filesindirectory.Count());

            foreach (string item in filesindirectory)
            {
                images.Add(System.IO.Path.GetFileName(item));
            }

            RepeaterImages.DataSource = images;
            RepeaterImages.DataBind();
        }
    }

    //void Pager1_ChangePage(object sender, EventArgs e)
    //{
    //    string[] filesindirectory = Directory.GetFiles(Server.MapPath("~/Images"));
    //    List<String> images = new List<string>(filesindirectory.Count());

    //    foreach (string item in filesindirectory)
    //    {
    //        images.Add(String.Format("~/Images/{0}", System.IO.Path.GetFileName(item)));
    //    }

    //    RepeaterImages.DataSource = images;
    //    RepeaterImages.DataBind();
    //}
}
